package org.android.tools;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;

public class ProductPlus implements KvmSerializable {
	
	public Integer idproductPlus;
	public int idProduct;
	public int idUser;

   public ProductPlus() {
   }

   public ProductPlus(int idProduct, int idUser) {
      this.idProduct = idProduct;
      this.idUser = idUser;
   }
   
   public Object getProperty(int arg0) {
		// TODO Auto-generated method stub
		switch(arg0) {
		case 0:
			return idProduct;
		case 1:
			return idproductPlus;
		case 2:
			return idUser;
		}
		return null;
	}
   
   public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 3;
	}

	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
		// TODO Auto-generated method stub
		switch(arg0)
       {
       case 0:
       	arg2.type = PropertyInfo.INTEGER_CLASS;
       	arg2.name = "idProduct";
       	break;
       case 1:
          	arg2.type = PropertyInfo.INTEGER_CLASS;
          	arg2.name = "idproductPlus";
          	break;
       case 2:
          	arg2.type = PropertyInfo.INTEGER_CLASS;
          	arg2.name = "idUser";
          	break;
       default:break;
       }
	}

	public void setProperty(int arg0, Object arg1) {
		// TODO Auto-generated method stub
		switch(arg0)
       {
       case 0:
    	   idProduct = Integer.parseInt(arg1.toString());
           break;
       case 1:
    	   idproductPlus = Integer.parseInt(arg1.toString());
           break;
       case 2:
    	   idUser = Integer.parseInt(arg1.toString());
           break;
       default:
           break;
       }
	}
	
	public static ProductPlus parseProductPlus(SoapObject soap, int arg0)
	{
		SoapObject arg1 = (SoapObject) soap.getProperty(arg0);
		ProductPlus productPlus = new ProductPlus();
		productPlus.idProduct = Integer.parseInt(arg1.getProperty(0).toString());
		productPlus.idproductPlus = Integer.parseInt(arg1.getProperty(1).toString());
		productPlus.idUser = Integer.parseInt(arg1.getProperty(2).toString());
		return productPlus;
	}
}
